package com.dzx.design.creational.simplefactory;

/**
 * @author dzx
 * @ClassName:
 * @Description:  简单工厂模式
 * @date 2019年06月26日 16:24:35
 */
public class Test {
    
    public static void main(String[] args){
        VideoFactory videoFactory = new VideoFactory();
        Video java = videoFactory.getVideo("java");
        Video python = videoFactory.getVideo("python");
        if(java ==null){
            return;
        }
        java.produce();
        if(python ==null){
            return;
        }
        python.produce();

         java = videoFactory.getVideoByReflect(JavaVideo.class);
        if(java ==null){
            return;
        }
        java.produce();
        python = videoFactory.getVideoByReflect(PythonVideo.class);
        if(python ==null){
            return;
        }
        python.produce();

    }
}
